package com.elai.baseconfig.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.baseconfig.mapper.OperateEquityItemMapper;
import com.elai.baseconfig.domain.OperateEquityItemDO;
import com.elai.baseconfig.service.OperateEquityItemService;

/**
 * 权益项目Service业务层处理
 *
 * @author elai
 * @date 2021-04-10
 */
@Service
public class OperateEquityItemServiceImpl implements OperateEquityItemService
{
    @Autowired
    private OperateEquityItemMapper operateEquityItemMapper;

    /**
     * 查询权益项目
     *
     * @param id 权益项目ID
     * @return 权益项目
     */
    @Override
    public OperateEquityItemDO selectOperateEquityItemById(Long id)
    {
        return operateEquityItemMapper.selectOperateEquityItemById(id);
    }

    /**
     * 查询权益项目列表
     *
     * @param operateEquityItem 权益项目
     * @return 权益项目
     */
    @Override
    public List<OperateEquityItemDO> selectOperateEquityItemList(OperateEquityItemDO operateEquityItem)
    {
        return operateEquityItemMapper.selectOperateEquityItemList(operateEquityItem);
    }

    /**
     * 新增权益项目
     *
     * @param operateEquityItem 权益项目
     * @return 结果
     */
    @Override
    public int insertOperateEquityItem(OperateEquityItemDO operateEquityItem)
    {
        operateEquityItem.setCreateTime(DateUtils.getNowDate());
    operateEquityItem.setUpdateTime(DateUtils.getNowDate());
        return operateEquityItemMapper.insertOperateEquityItem(operateEquityItem);
    }

    /**
     * 修改权益项目
     *
     * @param operateEquityItem 权益项目
     * @return 结果
     */
    @Override
    public int updateOperateEquityItem(OperateEquityItemDO operateEquityItem)
    {
        operateEquityItem.setUpdateTime(DateUtils.getNowDate());
        return operateEquityItemMapper.updateOperateEquityItem(operateEquityItem);
    }

    /**
     * 批量删除权益项目
     *
     * @param ids 需要删除的权益项目ID
     * @return 结果
     */
    @Override
    public int deleteOperateEquityItemByIds(Long[] ids)
    {
        return operateEquityItemMapper.deleteOperateEquityItemByIds(ids);
    }

    /**
     * 删除权益项目信息
     *
     * @param id 权益项目ID
     * @return 结果
     */
    @Override
    public int deleteOperateEquityItemById(Long id)
    {
        return operateEquityItemMapper.deleteOperateEquityItemById(id);
    }
}
